package bpm.dao.impl.agenda;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import bpm.domain.agenda.Agenda;
import bpm.domain.user.OrgUser;
/**
 * 
 * @author ZhaoWangLong Dec 13, 2011
 *
 */
public class AgendaRowMapper implements RowMapper {

	public Object mapRow(ResultSet rs, int i) throws SQLException {
		Agenda agenda=new Agenda();
		agenda.setId(rs.getString("ID"));
		OrgUser register = new OrgUser();
		register.setId(rs.getString("REGISTER_ID"));
		register.setName(rs.getString("REGISTER_NAME"));
		agenda.setRegister(register);
		agenda.setRegistTime(rs.getDate("REGISTER_TIME"));
		agenda.setUpdateTime(rs.getDate("UPDATE_TIME"));
		agenda.setStartTime(rs.getDate("START_TIME"));
		agenda.setEndTime(rs.getDate("END_TIME"));
		agenda.setAgendaContent(rs.getString("AGENDA_CONTENT"));
		agenda.setState("1".equals(rs.getString("STATE"))?true:false);
		agenda.setShare("1".equals(rs.getString("SHARE"))?true:false);
		agenda.setRemind("1".equals(rs.getString("REMIND"))?true:false);
		agenda.setRemindTime(rs.getDate("REMIND_TIME"));
		agenda.setRemindContent(rs.getString("REMIND_CONTENT"));
		agenda.setAddress(rs.getString("ADDRESS"));
		agenda.setRemark(rs.getString("REMARK"));
		return agenda;
	}

}
